import { createRouter, createWebHashHistory } from 'vue-router'

// 1. 定义路由组件（此处直接导入示例组件，实际项目中可按需懒加载）
import Home from '../components/Home.vue'  
import About from '../components/About.vue' 
import HelloWorld from '../components/HelloWorld.vue'
import MainLayout from '../components/MainLayout.vue'
import Login from '../components/Login.vue'
//import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
import vuestudy from '../components/vuestudy.vue'
import Studentform from '../components/studenttable.vue'
import add_student from '../components/add_student_form.vue'
//import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
//import component from 'element-plus/lib/components/tree-select/src/tree-select-option.js'

// 2. 配置路由规则
const routes = [
  { path: '/login', component: Login },
  {
    path: '/',component: MainLayout,
    children: [
      { path: 'home', component: Home },
      { path: 'about', component: About },
      { path: 'Hello', component: HelloWorld },
      { path:"vuestudy",component:vuestudy},
      {path:"studentform",component:Studentform},
      {path:"addstudent",component:add_student},
    ]
  },
  { path: '/', redirect: '/login' }
]

// 3. 创建路由实例
const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router